package com.jsong.linuo.recursion;

/**
 * @Author: 黎诺
 * @CreateTime: 2025-04-22
 * @Description: 递归练习2:斐波那契数列
 */

public class Recursion02 {
    public static void main(String[] args) {
        int result = method(6);
        System.out.println("result = " + result);
    }

    public static int method(int month) {
        if (month == 1 || month == 2) {
            return 1;
        }

        return method(month - 2) + method(month - 1);
    }

}
